Conditions | 1 |
Total Lines | 10 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | /* eslint-disable import/no-commonjs */ |
||
12 | function isPathInside(childPath, parentPath) { |
||
13 | const relation = path.relative(parentPath, childPath); |
||
14 | |||
15 | return Boolean( |
||
16 | relation && |
||
17 | relation !== '..' && |
||
18 | !relation.startsWith(`..${path.sep}`) && |
||
19 | relation !== path.resolve(childPath) |
||
20 | ); |
||
21 | } |
||
22 | |||
44 |